export class Realm {
  constructor() {
    this.global = new Map()
    this.Object = new Map()
    this.Object.call = function() {

    }
    this.Object_prototype = new Map()
  }
}

export class EnvironmentRecord {
  constructor() {
    this.thisValue
    this.varables = new Map()
    this.outer = null
  }
}

export class ExecutionContext {
  constructor(realm, lexicalEnvironment, variableEnvironment) {
    variableEnvironment = variableEnvironment || lexicalEnvironment
    this.lexicalEnvironment = lexicalEnvironment
    this.variableEnvironment = variableEnvironment
    this.realm = realm
  }
}

export class Reference {
  constructor(object, property) {
    this.object = object
    this.property = property
  }
  set(val) {
    this.object[this.property] = val
  }
  get() {
    return this.object[this.property]
  }
}